from django.db import models

# Create your models here.

class School(models.Model):
    SCHOOLTYPE = (('公办','公办'),('民办','民办'),('普惠性民办幼儿园','普惠性民办幼儿园'))
    DISABLECHOICES = ((True,'是'),(False,'否'))
    name = models.CharField(max_length=100,verbose_name='学校')
    mark = models.CharField(max_length=50,verbose_name='标识号')
    longitude = models.CharField(max_length=50,verbose_name='经度')
    latitude = models.CharField(max_length=50,verbose_name='纬度')
    create_date = models.DateField(verbose_name='创建时间')
    address = models.CharField(max_length=200,verbose_name='地址')
    organizers = models.CharField(max_length=100,verbose_name='举办者')
    credit_code = models.CharField(max_length=100,verbose_name='统一信用代码')
    school_type = models.CharField(max_length=100,verbose_name='类型',choices=SCHOOLTYPE)
    disable = models.BooleanField(choices=DISABLECHOICES,verbose_name='是否停办')

    class Meta:
        verbose_name = "学校信息"
        verbose_name_plural = verbose_name

    def __str__(self):
        return '%s' %self.name


class Grade(models.Model):
    grade = models.CharField(max_length=50,verbose_name='年级')

    class Meta:
        verbose_name = '年级'
        verbose_name_plural = verbose_name

    def __str__(self):
        return '%s' %self.grade


class ClassBj(models.Model):
    class_bj = models.CharField(max_length=10,verbose_name='班级')

    class Meta:
        verbose_name = '班级'
        verbose_name_plural = verbose_name

    def __str__(self):
        return '%s' %self.class_bj 

class Subject(models.Model):
    subject = models.CharField(max_length=50,verbose_name='科目')

    class Meta:
        verbose_name = '科目'
        verbose_name_plural = verbose_name

    def __str__(self):
        return '%s' %self.subject

class Nation(models.Model):
    nation_code = models.CharField(max_length=2,verbose_name='民族编码')
    nation = models.CharField(max_length=20,verbose_name='民族')

    class Meta:
        verbose_name='民族'
        verbose_name_plural = verbose_name

    def __str__(self):
        return '%s' %self.nation

class PoliticalClimate(models.Model):
    POLITICAL_CLIMATE_CHOICES = (('中共党员','中共党员'),('中共预备党员','中共预备党员'),('共青团员','共青团员'),
        ('民革党员','民革党员'),('民盟盟员','民盟盟员'),('民建会员','民建会员'),('民进会员','民进会员'),
        ('农工党党员','农工党党员'),('致公党党员','致公党党员'),('九三学社社员','九三学社社员'),('台盟盟员','台盟盟员'),
        ('无党派人士','无党派人士'),('群众','群众'))
    political_climate = models.CharField(verbose_name='政治面貌',choices=POLITICAL_CLIMATE_CHOICES,max_length=16)
    
    class Meta:
        verbose_name = '政治面貌'
        verbose_name_plural = verbose_name

    def __str__(self):
        return '%s' %self.political_climate